home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
batchut
/
funky.zip
/
FUNKY.DOC
< prev
next >
Wrap
Text File
|
1993-02-20
|
2KB
|
46 lines
-----------------------------------------------------------------
FUNKY.COM January 9,1993 Larry Furneaux
-----------------------------------------------------------------
Use for conditional branching in batch file process based on a
return code (errorlevel) between 0 and 10 representing:
ERRORLEVEL 0 -ESCape Key was pressed
ERRORLEVEL (1-10) -Corresponding Function(#) key pressed
Invalid responses are ignored. Program will not return to the
batch file process until a valid key is entered.
SYNTAX : FUNKY [promptstring] [/maxnum]
OPTIONS: promptstring- String to display before input is requested.
: /maxnum - Digit 1 to 9. Sets max valid Fkey # accepted
as input. (Default without switch = 10)
Ex: funky Enter your selection :/5
Displays 'Enter your selection :' at left edge of screen
with cursor positioned here------^. ESC and F1 to F5 would
be accepted. Input F# key is printed followed by CR and LF.
NOTES:
1. LEADING spaces on prompt string are ignored. Horiz tabbing can
be done with ANSI esc sequences or by entering a control char
as first char, followed by spaces + - text string.
Ex: "^H<- spaces ->" as prompt string, positions cursor and
displays the input F-key at cursor location.
2. When invoked WITHOUT a prompt string, (with or without the
/maxnum switch), the input F- key is not displayed on screen.
3. The code parses only the 1st char following the '/'. Thus if
/10 was entered, it would be interpreted as 1. Omit the switch
to enable maxnum=10 (ie default). If the char is not a digit
between 1 and 9, the switch is ignored and defaults to 10.
*4. The DOS "if errorlevel <num>" function evaluates as TRUE if the
returned error code is equal to OR GREATER THAN <num>. Branch
testing must be done from HIGHEST value (maxnum) to LOWEST (0).
For non-sequential values (ex: Input F5 OR F10) test as follows:
IF errorlevel 10 Goto F10 { branch to :F10 label
IF errorlevel 6 Goto GetInput { loop back if F6/7/8/9
IF errorlevel 5 Goto F5 { branch to :F5 label
IF errorlevel 1 Goto GetInput { loop back if F1/2/3/4
GOTO ESCAPE { esc key pressed (errlvl 0)